unit Principal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls, ComCtrls, Menus, ActnList, ImgList,
  ToolWin, DB , login;

type
  TFprincipal = class(TForm)
    StatusBar1: TStatusBar;
    ToolBar1: TToolBar;
    MainMenu1: TMainMenu;
    Cadastros1: TMenuItem;
    Clientes1: TMenuItem;
    PlanodeContas1: TMenuItem;
    HistricosPadres1: TMenuItem;
    Usurios1: TMenuItem;
    Relatrios1: TMenuItem;
    Balancete1: TMenuItem;
    Utilitrios1: TMenuItem;
    ImportarDados1: TMenuItem;
    ConfigurarImpresso1: TMenuItem;
    CpiadeSegurana1: TMenuItem;
    RestaurarcpiadeSegurana1: TMenuItem;
    Ajuda1: TMenuItem;
    SobreoSistema1: TMenuItem;
    Ajuda2: TMenuItem;
    Sair1: TMenuItem;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton5: TToolButton;
    ImageList1: TImageList;
    RecibosMensaisAdvocacia1: TMenuItem;
    Bancos1: TMenuItem;
    Itens1: TMenuItem;
    Retenes1: TMenuItem;
    Clientes2: TMenuItem;
    Usurios2: TMenuItem;
    Emissor1: TMenuItem;
    procedure BitBtn4Click(Sender: TObject);
    procedure Sair1Click(Sender: TObject);
    procedure BitBtn8Click(Sender: TObject);
    procedure PlanodeContas1Click(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure ToolButton7Click(Sender: TObject);
    procedure ToolButton5Click(Sender: TObject);
    procedure ToolButton2Click(Sender: TObject);
    procedure ToolButton3Click(Sender: TObject);
    procedure ToolButton1Click(Sender: TObject);
    procedure Itens1Click(Sender: TObject);
    procedure Emissor1Click(Sender: TObject);
    procedure Clientes1Click(Sender: TObject);
    procedure HistricosPadres1Click(Sender: TObject);
    procedure Usurios1Click(Sender: TObject);
    procedure Bancos1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Clientes2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Fprincipal: TFprincipal;
  moperador : string;

implementation

uses Contas, hp, diario, Clientes, ClientesConsulta, Tabela_Temporaria,
  razaotemp, Dados, espelho, saldos, operadores, senhas, recibos, saldo,
  pagar, recibocontabil, receber, fatura, emissor, retencao, bancos;

{$R *.dfm}


procedure TFprincipal.BitBtn4Click(Sender: TObject);
begin
  application.CreateForm(tfdiario,fdiario);
  fdiario.showmodal;
  fdiario.Free;
end;


procedure TFprincipal.Sair1Click(Sender: TObject);
begin
 close;
end;

procedure TFprincipal.BitBtn8Click(Sender: TObject);
begin
close;
end;

procedure TFprincipal.PlanodeContas1Click(Sender: TObject);
begin
  Application.CreateForm(TFhp,Fhp);
  fhp.showmodal;
  fhp.Free;
end;

procedure TFprincipal.FormCloseQuery(Sender: TObject;
  var CanClose: Boolean);
begin
Canclose := application.MessageBox('Deseja fechar o sistema ?','Confirmar',MB_ICONQUESTION + MB_YESNO) = IDYES;
end;

procedure TFprincipal.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#27 then
   begin
   close;
end;

end;

procedure TFprincipal.ToolButton7Click(Sender: TObject);
begin
 close;
end;

procedure TFprincipal.ToolButton5Click(Sender: TObject);
begin
close;

end;

procedure TFprincipal.ToolButton2Click(Sender: TObject);
begin
  application.CreateForm(tfclientes,fclientes);
  fclientes.showmodal;
  fclientes.Free;
end;

procedure TFprincipal.ToolButton3Click(Sender: TObject);
begin
 application.CreateForm(tffatura,ffatura);
  ffatura.showmodal;
  ffatura.Free;
end;

procedure TFprincipal.ToolButton1Click(Sender: TObject);
begin
  application.CreateForm(tfdiario,fdiario);
  fdiario.showmodal;
  fdiario.Free;

end;

procedure TFprincipal.Itens1Click(Sender: TObject);
begin
  Application.CreateForm(TFbancos,Fbancos);
  fbancos.showmodal;
  fbancos.Free;
end;

procedure TFprincipal.Emissor1Click(Sender: TObject);
begin
  application.CreateForm(tfemissor,femissor);
  femissor.showmodal;
  femissor.Free;

end;

procedure TFprincipal.Clientes1Click(Sender: TObject);
begin
  Application.CreateForm(TFcontas,Fcontas);
  Fcontas.showmodal;
  Fcontas.Free;
end;

procedure TFprincipal.HistricosPadres1Click(Sender: TObject);
begin
  application.CreateForm(tfdiario,fdiario);
  fdiario.showmodal;
  fdiario.Free;
end;

procedure TFprincipal.Usurios1Click(Sender: TObject);
begin
 application.CreateForm(tffatura,ffatura);
  ffatura.showmodal;
  ffatura.Free;
end;

procedure TFprincipal.Bancos1Click(Sender: TObject);
begin
  Application.CreateForm(TFretencao,Fretencao);
  Fretencao.showmodal;
  Fretencao.Free;
end;

procedure TFprincipal.FormCreate(Sender: TObject);
begin
  if TFlogin.Create(Self).ShowModal = mrCancel then
    begin
    Application.Terminate;
    Exit;
  end;
end;

procedure TFprincipal.Clientes2Click(Sender: TObject);
begin
  application.CreateForm(tfclientes,fclientes);
  fclientes.showmodal;
  fclientes.Free;
end;

end.
